// 存放的属性值
const state = {
    dataList: [],
    parentDeptId: "",
    provice: "", //城市
    infoDept: {
        infoDeptLevel: "",
        deptId: "",
    },
    hcaDept: {
        infoDeptLevel: "",
        deptId: "",
    },
    hcaParentDeptId: "", //首页统计的上一级deptId
};
// 存放的方法
const mutations = {
    stateInfo(state, data) {
        state.dataList = data;
    },
    setprovice(state, data) {
        state.provice = data;
    },
    commprovice(state, data) {
        state.provice = "";
    },
    seTinfoDeptLevel(state, data) {
        state.infoDept = {
            deptId: data.deptId,
            infoDeptLevel: data.deptLevel,
        };
    },
    // 设置父级
    seTparentDeptId(state, data) {
        state.parentDeptId = data;
    },
    // 重置级别
    comminfoDeptLevel(state, data) {
        state.infoDeptLevel = "0";
    },
    seThcaDeptLevel(state, data) {
        state.hcaDept = {
            deptId: data.deptId,
            infoDeptLevel: data.deptLevel,
        };
    },
    // 设置父级
    seThcaparentDeptId(state, data) {
        state.hcaParentDeptId = data;
    },
};
const actions = {
    seTinfo({ commit }, data) {
        // 恢复默认值
        commit("seTinfoDeptLevel", data);
    },
    seTparent({ commit }, data) {
        // 恢复默认值
        commit("seTparentDeptId", data);
    },
};
export default {
    namespaced: true,
    state,
    mutations,
    actions,
};
